<h1>Order details</h1>
<?=Html::anchor(Request::$controller . 'orders/', '&larr; back to orders');?>
<br /><br />
<table class="w100">
	<tr>
		<td class="half paddingRight10 w50">
			Order #<?=$order['token']?><br />
			<? if ($order['delivery']): ?>
				Delivery: <strong><?=$order['delivery'];?></strong><br />
			<? endif ?>
			Amount: $<?=$order['amount']?><br />
			Date: <?=$order['dateTimeAdded']?><br />
			Status: <?=($order['isPaid'] == 1 ? 'paid' : 'unpaid')?><br />
			<hr />
                        <table>
                            <tr>
                                <td class="paddingRight10 w25">
                                    <h3>Shipping information:</h3>
                                    First Name: <?=Html::chars($order['shipping_firstName'])?><br />
                                    Second Name: <?=Html::chars($order['shipping_secondName'])?><br />
                                    Address: <?=Html::chars($order['shipping_adressLine1'])?><br />
                                    Address2: <?=Html::chars($order['shipping_adressLine2'])?><br />
                                    City: <?=Html::chars($order['shipping_city'])?><br />
                                    State: <?=Html::chars($order['shipping_state'])?><br />
                                    Zip: <?=Html::chars($order['shipping_zip'])?><br />
                                    Email: <?=nl2br(Html::chars($order['shipping_email']))?><br />
                                </td>
                                <td class="w25">
                                    <h3>Billing information:</h3>
                                    First Name: <?=Html::chars($order['billing_firstName'])?><br />
                                    Second Name: <?=Html::chars($order['billing_secondName'])?><br />
                                    Address: <?=Html::chars($order['billing_adressLine1'])?><br />
                                    Address2: <?=Html::chars($order['billing_adressLine2'])?><br />
                                    City: <?=Html::chars($order['billing_city'])?><br />
                                    State: <?=Html::chars($order['billing_state'])?><br />
                                    Zip: <?=Html::chars($order['billing_zip'])?><br />
                                    Email: <?=nl2br(Html::chars($order['billing_email']))?><br />
                                </td>
                            </tr>
                        </table>
		</td>
		<td class="half paddingLeft10">
			<?if (count($items)):?>
				<table class="w100">
					<tr>
						<td class="border padding10">
							Item name
						</td>
						<td class="border padding10" style="width: 50px;">
							Quantity
						</td>
						<td class="border padding10" style="width: 50px;">
							Price
						</td>
					</tr>
					<?foreach ($items as $item):?>
						<tr>
							<td class="border padding10">
								<?=Html::chars($item['itemName'])?>
								<? if ($item['source'] == 'advertising'): ?>
									(banner)
								<? endif ?>
							</td>
							<td class="border padding10" style="width: 50px;">
								<?=$item['quantity']?>
							</td>
							<td class="border padding10" style="width: 50px;">
								$ <?=$item['price']?>
							</td>
						</tr>
					<?endforeach?>
				</table>
			<?endif?>
		</td>
	</tr>
</table>